import { defineComponent, ref, useSlots, watch } from "vue";

export default defineComponent(
  (props) => {
    const show = ref(false);
    watch(
      () => props.visible,
      (flag) => {
        if (flag) show.value = true;
      }
    );

    const slots = useSlots();
    return () => show.value && slots.default?.();
  },
  {
    props: ["visible"],
  }
);
